

// 科技成果----科技奖项

import { CHECC_API_CMS } from '@/constants/proxy'
import request from '@/utils/request'
import { exportMethod } from '@/utils/utils'




//导出
const getExport = (data: any, fileName) => {
  const params = {
    method: 'post',
    url: CHECC_API_CMS + '/kjsl/tresult/techaward/export',
    data: data,
    fileName: fileName
  }
  return exportMethod(params)
}

// 数据字典
const getDictionary = (data: any = {}) => {
  return request.post(
    CHECC_API_CMS + `/dictItem/codelist`,
    data
  )
}


// 获取用户单位

const getUnit = (data: any = {}) => {
  return request.post(
    CHECC_API_CMS + `/kgptKjslTchieveSttrans/unitname`,
    data
  )
}

// 著作人

const getUser = (data: any = {}) => {
  return request.get(
    CHECC_API_CMS + `/user/getAll`,
    data
  )
}

// 项目
const getProject = (data: any = {}) => {
  return request.post(
    CHECC_API_CMS + `/xmzx/projectManagement/undertakeunit`,
    data
  )
}

const getTechnology = (data: any = {}) => {
  return request.post(
    CHECC_API_CMS + `/xmzx/projectManagement/undertakeunit`,
    data
  )
}

// 详情

const getDetailById = (params: any = {}) => {

  return request({
    url: CHECC_API_CMS + '/kjsl/tresult/techaward/getDetailById',
    method: 'post',
    params
  })
}



//新加/编辑

const editForm = (data: any = {}) => {
  return request.post(
    CHECC_API_CMS + `/kjsl/tresult/techaward/update`,
    data
  )
}


const addForm = (data: any = {}) => {
  return request.post(
    CHECC_API_CMS + `/kjsl/tresult/techaward/add`,
    data
  )
}


// 查询列表
const getTable = (data: any) => {
  return request({
    url: CHECC_API_CMS + '/kjsl/tresult/techaward/list',
    method: 'post',
    data
  })
}

// 解锁

const getUnlock = (id: any = {}) => {
  return request.get(
    CHECC_API_CMS + `/kjsl/tresult/techaward/unlock/${id}`,
  )
}

// 锁定

const getLock = (id: any = {}) => {
  return request.get(
    CHECC_API_CMS + `/kjsl/tresult/techaward/lock/${id}`,
  )
}

// 导出功能


// 确定当前流程

const getConfirm = (params: any = {}) => {

  return request({
    url: CHECC_API_CMS + '/kjsl/tresult/techaward/confirm/',
    method: 'get',
    params
  })


}




const queryNameById = (data: any) => {
  return request({
    url: CHECC_API_CMS + '/kgptKjslTawardTechresult/getDataList',
    method: 'post',
    data
  })
}


//删除(批量)
const getDelect = (id: any = {}) => {
  return request.delete(
    CHECC_API_CMS + `/kjsl/tresult/techaward/delete/${id}`,
  )
}

export { addForm, editForm, getConfirm, getDelect, getDetailById, getDictionary, getExport, getLock, getProject, getTable, getTechnology, getUnit, getUnlock, getUser, queryNameById }

